/*###############   COPYLEFT GPLv3 LICENSE   ###############
##
## JFX Version 0.2.7
## Website Management Software
## www.jfxcms.com
##
## Copyright 2009 GPLv3 - http://www.opensource.org/licenses/gpl-3.0.html
##
## Anthony Gallon
## oi_antz@hotmail.com
##
## Permission is hereby granted to any person having a copy of this software
## to freely use and modify as required so long as the copyright notices
## and branding remain intact.
##
## Full license details available at http://www.jfxcms.com/license
##
###############   COPYLEFT GPLv3 LICENSE   ###############*/

/**
 * Extended by JFX_Base to display log messages
 */
var JFX_Log = function(title){
    this.title = title;
    this.steps = Array();
    var div = document.createElement('div');
    var container = document.createElement('div');
    var h2 = document.createElement('h2');
    $(container).addClass('jfx-log');
    $(container).css('position', 'absolute');
    $(container).css('top', '5%');
    $(container).css('left', '12%');

    $(div).css('max-height', '200px');
    $(div).css('overflow', 'auto');

    $(h2).text(this.title);

    $(container).draggable({handle : h2});
    $(container).append(h2);
    $(container).append(div);
    $($('body').get(0)).prepend(container);
    this.logDiv = div;
    this.logDivContainer = container;
}

JFX_Log.prototype.step = function (description){
    var i = this.steps.length;
    var newStep = {'description' : description};
    this.steps[i] = newStep;

    var desc = document.createElement('p');
    $(desc).text(description);
    $(this.logDiv).prepend(desc);
}






